<?php
class NewsController extends Crb_Controller
{

	public function listAction()
	{
		$this->view->layout()->setLayout('admin');
		$news = new News();
		$this->view->news = $news->getList();
	}
	
	public function indexAction()
	{
		$news = new News();
		$this->view->news = $news->getList();
	}
	
	public function viewAction()
	{
		$One = new News();
		$this->view->One = $One->getOne($this->getRequest()->getParam('id'));
	}
	
	public function deleteAction()
	{
		$this->setNoRender();
        $this->disableLayout();
		$news = new News();
		$news->deleteNew($this->getRequest()->getParam('id'));	
		$this->_redirect('news/list');
	}
	
	public function editAction()
	{
		$this->view->layout()->setLayout('admin');
		$news = new News();
		$this->view->editNew = $news->getOne($this->getRequest()->getParam('id'));
		//$news->editNew($this->getRequest()->getParam('id'));	
		//$this->_redirect('news/list');
	}

	
}